package asruby.exceptions
{
    public class FlowControlException extends JumpException {
        protected  var target:JumpTarget;
        private  var value:Object;
        // FIXME: Remove inKernelLoop from this and come up with something more general
        // Hack to detect a break in Kernel#loop
        private  var inKernelLoop: Boolean =  false;

        public FlowControlException() {}
        public  function FlowControlException(target:JumpTarget, value:Object){
            this.target = target;
            this.value = value;
        }
        public JumpTarget getTarget() { return target; }
        public void setTarget(JumpTarget target) { this.target = target; }
        public Object getValue() { return value; }
        public void setValue(Object value) { this.value = value; }
        public void setBreakInKernelLoop(boolean inKernelLoop) { this.inKernelLoop = inKernelLoop; }
        public boolean isBreakInKernelLoop() { return inKernelLoop; }
    }
}